const pino = require('pino')
const dayjs = require('dayjs')

const log = pino({
  transport: { // pino 7.x的写法有所不同
    target: 'pino-pretty',
    options: {
      colorize: true
    }
  },
  base: {
    pid: false,
  },
  timestamp: () => `,"time":"${dayjs().format('YYYY/MM/DD HH:mm:ss')}"`,
})

module.exports = log